package com.sharding.transaction.demo.provider;

import com.sharding.transaction.demo.api.IAccountProviderService;
import com.sharding.transaction.demo.api.IOrderProviderService;
import com.sharding.transaction.demo.api.IStoreProviderService;
import com.sharding.transaction.demo.entity.Goods;
import com.sharding.transaction.demo.entity.Orders;
import com.sharding.transaction.demo.entity.User;
import com.sharding.transaction.demo.service.UserService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.beans.factory.annotation.Autowired;

@org.apache.dubbo.config.annotation.Service(protocol = "dubbo", version = "1.0.0", group = "sharding-tr")
public class UserProviderServiceImpl implements IAccountProviderService {

    @Autowired
    private UserService userService;

    @Override
    public User deductionAccountSuc(Long userId, Double price) {
        return userService.deductionAccount(userId, price);
    }

    @Override
    public User deductionStoreFail(Long userId, Double price) {
        return null;
    }
}
